package com.insurance.web;

import java.util.List;
import javax.annotation.Resource;

import com.insurance.bean.Agent;
import com.insurance.bean.Blog;
import com.insurance.bean.Question;
import com.insurance.service.BlogService;
import com.insurance.service.QuestionService;
import com.insurance.service.AgentService;
import com.insurance.bean.Caze;
import com.insurance.service.CazeService;
import com.insurance.bean.Product;
import com.insurance.service.ProductService;
import com.insurance.util.PageBean;



public class IndexAction {
	@Resource AgentService agentService;
	@Resource ProductService productService;
	@Resource CazeService cazeService;
	@Resource QuestionService questionService;
	@Resource BlogService blogService;
	private List<Agent> agents;
	private Agent agent;
	private List<Product> products;
	private Product product;
	private List<Caze> cazes;
	private Caze caze;
	private List<Question> questions;
	private List<Question> questions1;
	private Question question;
	private List<Blog> blogs;
	private Blog blog;
	private PageBean page;
	
	public List<Blog> getBlogs() {
		return blogs;
	}
	public void setBlogs(List<Blog> blogs) {
		this.blogs = blogs;
	}
	public Blog getBlog() {
		return blog;
	}
	public void setBlog(Blog blog) {
		this.blog = blog;
	}
	public PageBean getPage() {
		return page;
	}
	public void setPage(PageBean page) {
		this.page = page;
	}
	public List<Question> getQuestions1() {
		return questions1;
	}
	public void setQuestions1(List<Question> questions1) {
		this.questions1 = questions1;
	}
	public List<Agent> getAgents() {
		return agents;
	}
	public void setAgents(List<Agent> agents) {
		this.agents = agents;
	}
	public Agent getAgent() {
		return agent;
	}
	public void setAgent(Agent agent) {
		this.agent = agent;
	}
	public List<Product> getProducts() {
		return products;
	}
	public void setProducts(List<Product> products) {
		this.products = products;
	}
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	public List<Caze> getCazes() {
		return cazes;
	}
	public void setCazes(List<Caze> cazes) {
		this.cazes = cazes;
	}
	public Caze getCaze() {
		return caze;
	}
	public void setCaze(Caze caze) {
		this.caze = caze;
	}
	public List<Question> getQuestions() {
		return questions;
	}
	public void setQuestions(List<Question> questions) {
		this.questions = questions;
	}
	public Question getQuestion() {
		return question;
	}
	public void setQuestion(Question question) {
		this.question = question;
	}
	
	public String index(){
		
		this.products = this.productService.getProductsTop10();
		this.agents = this.agentService.getAgentsCheckedTop10();
		this.questions = this.questionService.getQuestionsTop5();
		this.questions1 = this.questionService.getQuestionsTop10();
		this.cazes = this.cazeService.getCazesTop5();
		this.blogs = this.blogService.getBlogsTop5();
		return "index";
	}

}
